On May 14, 2026, the merge button was pressed on a GitHub pull request that may mark a milestone in the JavaScript runtime landscape: Bun's entire Zig codebase has been rewritten in Rust and merged into main. Led by Jarred Sumner with AI assistance from Claude, this massive engineering effort spanned 6,755 commits and over one million lines of code. Hacker News responded with 464 points and 537 comments — and a deeply polarized reaction of 969 thumbs up vs 785 thumbs down.

A Week-Long Bet

The PR description was remarkably terse: "Blog post with details coming soon." But the numbers speak volumes. Bun now has over 1 million lines of Rust code, approaching the size of the Rust compiler itself. The binary shrank by 3-8MB. The entire pre-existing test suite passes on macOS, Linux, and Windows, with performance ranging from neutral to slightly faster. Several memory leaks and flaky tests were fixed in the process.

The core motivation? Jarred explained plainly: years of use-after-free, double-free, and forgot-to-free-on-error-path bugs had consumed enormous development and debugging time. Rust turns these into compile errors or automatic cleanup — not perfect, but a dramatic improvement.

Mechanical Translation or Deep Engineering?

One commenter discovered that the Bun Zig codebase had been carefully prepared before the migration: internal smart pointer types mapped one-to-one with Rust equivalents, and a bun_collections Rust crate already existed. This suggested a "fairly straightforward mechanical translation," prompting questions about why Claude was used instead of a custom Zig-to-Rust translator.

But the reality is messier: the new codebase contains 10,428 unsafe blocks across 736 files. This wasn't just automated line-by-line conversion — it was a selective migration that preserved low-level systems programming flexibility within Rust's safety boundaries. As Jarred noted, "Rust won't catch all of these — leaks from holding references too long and anything that re-enters across the JS boundary are still on us. But a large percentage of that list is use-after-free, double-free, and forgot-to-free-on-error-path, which become compile errors or automatic cleanup."

A Canary for Software Complexity

One HN observer captured the broader significance: "Bun is becoming the canary for software complexity management in the LLM era." If AI-assisted large-scale language migrations prove viable, the implications are staggering — C to Rust, Python to Mojo, legacy Java to Kotlin. Entire categories of technical debt could be redefined. But the risks are equally real: mechanical translation can introduce subtle behavioral differences, and 10,000+ unsafe blocks don't disappear by themselves. Whether this experiment proves prescient or premature, it has already become a defining case study in AI-era engineering practice.

📎 Source: Bun PR #30412 - Rewrite in Rust | 💬 HN Discussion: news.ycombinator.com